package org.jeecg.modules.sggg.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.sggg.entity.SgBlutdruckRecord;
import org.jeecg.modules.sggg.entity.SgGlucoseRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.sggg.entity.SgHealthRecord;
import org.jeecg.modules.sggg.entity.SgMember;

/**
 * @Description: 血糖记录表
 * @Author: jeecg-boot
 * @Date: 2022-10-17
 * @Version: V1.0
 */
public interface SgGlucoseRecordMapper extends BaseMapper<SgGlucoseRecord> {

    List<SgMember> queryPageListBySqlxt(Page<SgMember> page, String sysOrgCode,List<String> responsibleAgencies, Integer day, String roleCode, String userId,String name, String phone,boolean Bindstatus,int deviceType);

    IPage<SgGlucoseRecord> queryList(Page<SgGlucoseRecord> page, String orgCode, String memberId, String memberName, String memberPhone,List<String> responsibleAgencies, Integer intervene, String roleCode, String userId);

    List<SgGlucoseRecord> getGlucoseRecord(String memberId);

    int getGlucoseStatistics(String memberId, Integer level);

    SgGlucoseRecord getGlucoseStatisticsByDate(String memberId, String dateStartTime, String dateEndTime);

    Double getGlucoseStatisticsAvg(String memberId, Integer flag);

    Double getGlucoseStatisticsById(String memberId, Integer phase);

    /*大屏--高危干预预警*/
    List<Map<String, Object>> interventionWarning(String orgCode);

    /*大屏--三高管理人数*/
    List<Map<String, Object>> threeHighNumber(String orgCode);

    IPage<SgGlucoseRecord> queryListByDoctor(Page<SgGlucoseRecord> page, String name, String phone, List<String> responsibleAgencies,String sysOrgCode, String roleCode, String doctorId, String intervene);

    /*今日血汤测量人数*/
    List<SgGlucoseRecord> dayMeasureNumberCount(String sysOrgCode, String roleCode, String date, String doctorId, String intervene,List<String> responsibleAgencies);

    List<SgGlucoseRecord> dayMeasureNumberCountTwo(String sysOrgCode, String roleCode, String date, String doctorId, String intervene,List<String> responsibleAgencies);

    List<Map<String, Integer>> getEachLevelNum(String orgCode);
}
